package ext.opensource.netty.common.exception;

public class MethodNotSupportException extends RuntimeException {
	private static final long serialVersionUID = 1L;

	public MethodNotSupportException() {
		super(MethodNotSupportException.getMsgStr());
	}

	private static String getMsgStr() {
		String className = "";
		String methodName = "";
		final Thread cur = Thread.currentThread();
		final int iLevel = 3;
		if (cur != null) {
			final StackTraceElement[] ary = cur.getStackTrace();
			if ((ary != null) && (ary.length > iLevel)) {
				className = ary[iLevel].getClassName();
				methodName = ary[iLevel].getMethodName();
			}
		}

		return String.format("Method Not Support: %s-%s", className, methodName);
	}
}
